<template>
    <div>
      {{ msg }}
      <button v-on:click="run">在事件处理方法中调用其他方法</button>
    </div>
  </template>
  
  <script>
  import { reactive, toRefs } from 'vue'
  
  export default {
    setup () {
      const state = reactive({
        msg:'hello',
      })
      const getmsg=()=>{
        alert(state.msg)
      }
      const run=()=>{
        getmsg()
      }
      return {
        ...toRefs(state),
        run,
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  
  </style>